﻿using DailyPoetryH.Data;
using DailyPoetryH.Library.Services;
using DailyPoetryH.Services;
using Microsoft.Extensions.Logging;

namespace DailyPoetryH
{
    public static class MauiProgram
    {
        public static MauiApp CreateMauiApp()
        {
            var builder = MauiApp.CreateBuilder();
            builder
                .UseMauiApp<App>()
                .ConfigureFonts(fonts =>
                {
                    fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                });

            builder.Services.AddMauiBlazorWebView();
            builder.Services.AddBootstrapBlazor();

#if DEBUG
		builder.Services.AddBlazorWebViewDeveloperTools();
		builder.Logging.AddDebug();
#endif

            builder.Services.AddSingleton<WeatherForecastService>();
            builder.Services.AddScoped<IPoetryStorage, PoetryStorage>();
            builder.Services.AddScoped<IPreferenceStorage, PreferenceStorage>();
            builder.Services.AddScoped<INavigationService, NavigationService>();
            builder.Services.AddScoped<IAlertService, AlertService>();
            builder.Services.AddScoped<ITodayPoetryService, JinrishiciService>();
            builder.Services.AddScoped<ITodayImageService, BingImageService>();
            builder.Services.AddScoped<ITodayImageStorage, TodayImageStorage>();
            builder.Services.AddScoped<IParcelBoxService, ParcelBoxService>();
            builder.Services.AddScoped<IFavoriteStorage, FavoriteStorage>();
            builder.Services.AddScoped<IPhotoService, PhotoService>();
            builder.Services
                .AddScoped<IPoetrilizationService, PoetrilizationService>();

            return builder.Build();
        }
    }
}